<%@ page
	import="com.serviceprovider.business.utility.SecurityContextUser"%>
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%--@elvariable id="states" type="java.util.List<State>"--%>
<%--@elvariable id="roleList" type="java.util.List<Role>"--%>
<%--@elvariable id="elements" type="com.serviceprovider.business.module.user.model.interfaces.IElements"--%>

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><spring:message
	code="${elements.suffix}.view.user.details.title" /></title>
<link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<script src="<c:url value="/javascripts/common.js"/>"
	type="text/javascript"></script>



<c:if test="<%=SecurityContextUser.isAdmin()%>">
	<%@include file="/WEB-INF/jsp/admin/top_menu.jsp"%>
</c:if>
<c:if test="<%=SecurityContextUser.isServiceProvider()%>">
	<%@include file="/WEB-INF/jsp/serviceprovider/top_menu.jsp"%>
</c:if>
<c:if test="<%=SecurityContextUser.isPayee()%>">
	<%@include file="/WEB-INF/jsp/serviceprovider/top_menu.jsp"%>
</c:if>

<table width=100%>

	<tr>
		<td>
		<div id="editProfileMenuId"
			style="display: ${elements.editProfileMenu}"><c:import
			url="/WEB-INF/jsp/menu/edit_profile_user_menu.jsp" /><br />
		</div>
		</td>
	</tr>


	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>
</table>
<div class="contentArea"><form:form commandName="viewUserForm"
	action="search_users.htm" method="get" name="viewForm">

	<table width=70% class="formTable">
		<c:if test="${viewUserForm.saveSuccess == true}">
			<tr>
				<td colspan="2" align="center"><font color="red"><b><spring:message
					code="${elements.suffix}.view.user.details.savesuccess" /></b></font></td>
			</tr>
		</c:if>
		<tr>
			<td colspan="2" align="center"><c:if
				test="${viewUserForm.saveSuccess == false}">
				<form:hidden path="id" id="userId" />
				<input type="button" onclick="goToSearch()"
					class='ui-button ui-state-default ui-corner-all'
					value="<spring:message code="${elements.suffix}.view.user.details.back"/>" />
				<input type="button" onclick="goToEdit()"
					class='ui-button ui-state-default ui-corner-all'
					value="<spring:message code="${elements.suffix}.edit.user.details.title"/>" />
			</c:if> <c:if test="${viewUserForm.saveSuccess == true}">
				<input type="submit"
					class='ui-button ui-state-default ui-corner-all'
					value="<spring:message code="${elements.suffix}.view.user.details.continue"/>" />
			</c:if></td>
		</tr>

		<tr class="formHeader">
			<td colspan="2" align="left"><b><spring:message
				code="${elements.suffix}.view.user.details.subtitle" /></b></td>
		</tr>
	</table>
	<div id="accordion"><h3><a href="#"> <spring:message
		code="${elements.suffix}.view.user.details.account"/> </a></h3>
	<div>
	<table width=70% class="formTable">

		<tr>
			<td width="175px"><spring:message
				code="${elements.suffix}.view.user.details.email" /></td>
			<td>${viewUserForm.email}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.alternate" /></td>
			<td>${viewUserForm.alternateEmail}</td>
		</tr>

		<tr>
			<td>
			<div id="roleLabelId" style="display: ${elements.roleLabel}"><spring:message
				code="${elements.suffix}.view.user.details.role" /></div>
			</td>
			<td>
			<div id="roleValueId" style="display: ${elements.roleValue}">
			${viewUserForm.role.name}</div>
			</td>
		</tr>

		<tr>
			<td>
			<div id="level1UsersLabelId"
				style="display: ${elements.level1UsersLabel}"><spring:message
				code="${elements.suffix}.view.user.details.level1user" /></div>
			</td>
			<td>
			<div id="level1UsersValueId"
				style="display: ${elements.level1UsersValue}">
			${viewUserForm.level1User.email}</div>
			</td>
		</tr>
	</table>
	</div>
	<h3><a href="#"> <spring:message
		code="${elements.suffix}.view.user.details.general" /> </a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.firstname" /></td>
			<td>${viewUserForm.firstName}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.middlename" /></td>
			<td>${viewUserForm.milddleName}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.lastname" /></td>
			<td>${viewUserForm.lastName}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.efin" /></td>
			<td><c:if test="${viewUserForm.efin != 0}">
	    	        ${viewUserForm.efin}
                </c:if></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.ssn" /></td>
			<td><c:if test="${viewUserForm.ssn !=0}">
	    	        ${viewUserForm.ssn}
                </c:if></td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.ptin" /></td>
			<td><c:if test="${viewUserForm.ptin !=0}">
	    	        ${viewUserForm.ptin}
                </c:if></td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.businessname" /></td>
			<td>${viewUserForm.businessName}</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.businessfein" /></td>
			<td>${viewUserForm.businessFein}</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.ownerssn" /></td>
			<td><c:if test="${viewUserForm.ownerSsn !=0}">
	    	       ${viewUserForm.ownerSsn}
                </c:if></td>
		</tr>
	</table>
	</div>
	<h3><a href=#> <spring:message
		code="${elements.suffix}.view.user.details.providerInformation" /></a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.firstname" /></td>
			<td>${viewUserForm.firstName}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.middlename" /></td>
			<td>${viewUserForm.milddleName}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.lastname" /></td>
			<td>${viewUserForm.lastName}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.efin" /></td>
			<td><c:if test="${viewUserForm.efin != 0}">
	    	        ${viewUserForm.efin}
                </c:if></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.ssn" /></td>
			<td><c:if test="${viewUserForm.ssn !=0}">
	    	        ${viewUserForm.ssn}
                </c:if></td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.ptin" /></td>
			<td><c:if test="${viewUserForm.ptin !=0}">
	    	        ${viewUserForm.ptin}
                </c:if></td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.businessname" /></td>
			<td>${viewUserForm.businessName}</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.businessfein" /></td>
			<td>${viewUserForm.businessFein}</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.ownerssn" /></td>
			<td><c:if test="${viewUserForm.ownerSsn !=0}">
	    	       ${viewUserForm.ownerSsn}
                </c:if></td>
		</tr>
	</table>
	</div>
	<h3><a href="#"> <spring:message
		code="${elements.suffix}.view.user.details.contactinfo" /></a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.streetAddress1" /></td>
			<td>${viewUserForm.contactAddress.streetAddress1}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.streetAddress2" /></td>
			<td>${viewUserForm.contactAddress.streetAddress2}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.city" /></td>
			<td>${viewUserForm.contactAddress.city}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.state" /></td>
			<td>${viewUserForm.contactAddress.state.name}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.country" /></td>
			<td>${viewUserForm.contactAddress.country.name}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.zip" /></td>
			<td>${viewUserForm.contactAddress.zip}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.firstphone" /></td>
			<td>${viewUserForm.contactAddress.phone}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.fax" /></td>
			<td>${viewUserForm.contactAddress.fax}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.cell" /></td>
			<td>${viewUserForm.contactAddress.cell}</td>
		</tr>
	</table>
	</div>
	<h3><a href="#"> <spring:message
		code="${elements.suffix}.view.user.details.businessinfo" /> </a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.streetAddress1" /></td>
			<td>${viewUserForm.businessAddress.streetAddress1}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.streetAddress2" /></td>
			<td>${viewUserForm.businessAddress.streetAddress2}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.city" /></td>
			<td>${viewUserForm.businessAddress.city}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.state" /></td>
			<td>${viewUserForm.businessAddress.state.name}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.country" /></td>
			<td>${viewUserForm.businessAddress.country.name}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.zip" /></td>
			<td>${viewUserForm.businessAddress.zip}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.phone" /></td>
			<td>${viewUserForm.businessAddress.phone}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.fax" /></td>
			<td>${viewUserForm.businessAddress.fax}</td>
		</tr>
	</table>
	</div>
	<h3><a href="#"> <spring:message
		code="${elements.suffix}.view.user.details.shippinginfo" /></a></h3>

	<div>
	<table width=70% class="formTable">
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.streetAddress1" /></td>
			<td>${viewUserForm.shippingAddress.streetAddress1}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.streetAddress2" /></td>
			<td>${viewUserForm.shippingAddress.streetAddress2}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.city" /></td>
			<td>${viewUserForm.shippingAddress.city}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.state" /></td>
			<td>${viewUserForm.shippingAddress.state.name}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.country" /></td>
			<td>${viewUserForm.shippingAddress.country.name}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.zip" /></td>
			<td>${viewUserForm.shippingAddress.zip}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.phone" /></td>
			<td>${viewUserForm.shippingAddress.phone}</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.fax" /></td>
			<td>${viewUserForm.shippingAddress.fax}</td>
		</tr>
	</table>
	</div>
<h3>	<a href="#"> <spring:message
		code="${elements.suffix}.view.user.details.preferences" /> </a></h3>
	<div>
	<table width=70% class="formTable">
		<c:if test="${viewUserForm.role.id eq 2}">
			<tr id="orderApproval">
				<td><spring:message code="admin.create.user.orderapproval" /></td>
				<td><c:choose>
					<c:when test="${viewUserForm.orderApproval eq 1}">
						<spring:message code="admin.create.user.orderapproval.auto" />
					</c:when>
					<c:when test="${viewUserForm.orderApproval eq 2}">
						<spring:message code="admin.create.user.orderapproval.manual" />
					</c:when>
					<c:otherwise>
						<spring:message code="admin.create.user.orderapproval.notdefined" />
					</c:otherwise>
				</c:choose></td>
			</tr>

			<tr id="checkPrinting">
				<td><spring:message code="admin.create.user.checkprintingby" /></td>
				<td><c:choose>
					<c:when test="${viewUserForm.checkPrintingBy eq 1}">
						<spring:message code="admin.create.user.checkprintingby.admin" />
					</c:when>
					<c:when test="${viewUserForm.orderApproval eq 2}">
						<spring:message code="admin.create.user.checkprintingby.sp" />
					</c:when>
					<c:otherwise>
						<spring:message code="admin.create.user.orderapproval.notdefined" />
					</c:otherwise>
				</c:choose></td>
			</tr>
		</c:if>
		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.msgnotiftype" /></td>
			<c:if test="${viewUserForm.prefMessageNotifyType == 1}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotiftype.email" /><br />
				</td>
			</c:if>
			<c:if test="${viewUserForm.prefMessageNotifyType == 2}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotiftype.text" /><br />
				</td>
			</c:if>
			<c:if test="${viewUserForm.prefMessageNotifyType == 3}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotiftype.both" /><br />
				</td>
			</c:if>
			<c:if
				test="${viewUserForm.prefMessageNotifyType == 4 || user.prefMessageNotifyType == 0}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotiftype.none" /><br />
				</td>
			</c:if>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.view.user.details.msgnotifalert" /></td>
			<c:if test="${viewUserForm.prefMessageNotifyAlert == 1}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotifalert.every" /><br />
				</td>
			</c:if>
			<c:if test="${viewUserForm.prefMessageNotifyAlert == 2}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotifalert.only" /><br />
				</td>
			</c:if>
			<c:if test="${viewUserForm.prefMessageNotifyAlert == 3}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotifalert.when" /><br />
				</td>
			</c:if>
			<c:if test="${viewUserForm.prefMessageNotifyAlert == 4}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotifalert.reply" /><br />
				</td>
			</c:if>
			<c:if test="${viewUserForm.prefMessageNotifyAlert == 0}">
				<td><spring:message
					code="${elements.suffix}.view.user.details.msgnotifalert.none" /><br />
				</td>
			</c:if>
		</tr>
		<tr>
			<td><br>
			</td>
		</tr>
		<tr>
		</table>
		</div>
		<table width=70% class="formTable">
			<td colspan="2" align="center"><c:if
				test="${viewUserForm.saveSuccess == false}">
				<input type="button" onclick="goToSearch()"
					class='ui-button ui-state-default ui-corner-all'
					value="<spring:message code="${elements.suffix}.view.user.details.back"/>" />
				<input type="button" onclick="goToEdit()"
					class='ui-button ui-state-default ui-corner-all'
					value="<spring:message code="${elements.suffix}.edit.user.details.title"/>" />
			</c:if> <c:if test="${viewUserForm.saveSuccess == true}">
				<input type="submit"
					class='ui-button ui-state-default ui-corner-all'
					value="<spring:message code="${elements.suffix}.view.user.details.continue"/>" />
			</c:if></td>
		</tr>
	</table>
	
	</div>
	
</form:form></div> <script language="javascript" type="text/javascript">
	function goToSearch() {
		document.forms[0].action = "search_users.htm";
		document.forms[0].submit();
	}
	function goToEdit() {
		document.viewForm.action = "edit_user_details.htm";
		document.viewForm.method = "GET";
		document.viewForm.submit();
	}
	$( "#accordion" ).accordion();
	
	</script> <%@include file="/WEB-INF/jsp/include/footer.jsp"%>